﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CP.Entities;
using CP.Repositories.GPM;
using CP.Utility;

namespace CP.Controllers.GPM
{
    public class DepartmentController
    {
        public IList<Department> GetAllDepartments()
        {
            DepartmentRepository rep = new DepartmentRepository();
            return rep.GetAllDepts();
        }

        public Department GetDeptByID(int id)
        {
            DepartmentRepository rep = new DepartmentRepository();
            return rep.GetDeptByID(id);
        }

        public bool AddDept(Department dept)
        {
            DepartmentRepository rep = new DepartmentRepository();
            return rep.AddDept(dept);
        }

        public bool EditDept(Department dept)
        {
            DepartmentRepository rep = new DepartmentRepository();
            return rep.UpdateDept(dept); 
        }

        public bool DeleteDepts(IList<int> depts)
        {
            DepartmentRepository rep = new DepartmentRepository();
            return rep.DeleteDept(depts);
        }
 
     }
}
